home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 492 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: "john (j.d.) hickin" <hickin@bnr.ca>
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Correctness of compilers behavior
  5. Date: 14 Feb 1996 15:28:54 PST
  6. Organization: Bell-Northern Research
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4ft9i9$sdm@bmtlh10.bnr.ca>
  9. References: <3122157A.2EB2@orbotech.co.il>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. Mime-Version: 1.0
  12. Content-Type: text/plain; charset=us-ascii
  13. Content-Transfer-Encoding: 7bit
  14. X-Original-Date:  Wed, 14 Feb 1996 18:27:21 +0000 
  15. Content-Identifier:  Re: Correctne... 
  16. X-Mailer: Mozilla 1.1 (X11; I; HP-UX A.09.05 9000/715) 
  17. X-Url: news:3122157A.2EB2@orbotech.co.il 
  18. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  19.     iQBVAwUBMSJwQ0y4NqrwXLNJAQGZaQH+LIKvaILeD02obvGxuMedd8bLcTUr3jGA
  20.     ZJ3FG9eyZrmYVfK3d5xQu8cMcg+1+eTJrFvJ0Zjgui5gTshrBPUkQA==
  21.     =UJbQ
  22. Originator: austern@isolde.mti.sgi.com
  23.  
  24. |> for (unsigned i=0; i<size; ++i) {
  25. |>     (bptr+i)->~B();
  26. |>     new(aptr+i) A;
  27. |>   }
  28.  
  29. I think this should be two loops, the first running backwards to destroy the
  30. B's and the second running forwards to create the A's.
  31.  
  32.  
  33. |>  delete [] arr;
  34.  
  35. 'delete p' and 'delete[] p' where 'p = new(...) whatever' may be undefined.
  36.  
  37. -- 
  38. John Hickin      Nortel Technology, Montreal, Quebec
  39. (514) 765-7924   hickin@bnr.ca
  40. ---
  41. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  42.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  43.   in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
  44.